package com.ali.Reggie.common;

/**
 * @author ：ALi
 * @date ：Created in 2022/6/9 14:25
 * @description：基于ThreadLocal封装的工具类，用于保存和获取当前登录用户id
 * @modified By：
 * @version: $
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentID(Long id){
        threadLocal.set(id);
    }

    public static Long getCurrentID(){
        return threadLocal.get();
    }

}